package io.github.rascaler.dcenter.tasks;

import com.alibaba.fastjson.JSON;
import com.binance.connector.futures.client.exceptions.BinanceClientException;
import com.binance.connector.futures.client.exceptions.BinanceConnectorException;
import com.binance.connector.futures.client.impl.UMFuturesClientImpl;
import com.binance.connector.futures.client.utils.ProxyAuth;
import io.github.rascaler.dcenter.constant.ConstantItem;
import io.github.rascaler.dcenter.db.DbManager;
import io.github.rascaler.dcenter.manager.BinanceManager;
import io.github.rascaler.dcenter.platforms.DbMapper;
import io.github.rascaler.dcenter.platforms.Frequency;
import io.github.rascaler.dcenter.platforms.Parser;
import io.github.rascaler.dcenter.platforms.binance.*;
import io.github.rascaler.dcenter.pojo.Candlestick;
import io.github.rascaler.dcenter.pojo.FixedArrayList;
import io.github.rascaler.dcenter.properties.BinanceProperties;
import io.github.rascaler.dcenter.properties.ProxyInfo;
import io.github.rascaler.dcenter.ws.handler.KlineSubscribeMessageHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.stream.Collectors;


@Slf4j
@Component
public class BinanceInitTask {

    @Autowired
    private BinanceManager binanceManager;


    @Scheduled(cron = "${binance.initCron}")
    public void scheduled() {
        log.error("K线上/下架检查任务开始....");
        binanceManager.init();
        log.error("K线上/下架检查任务结束....");
    }



}
